home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / tos / updates / update21.zoo / util / diffs
Encoding:
Text File  |  1992-06-03  |  10.0 KB  |  451 lines

  1. *** 1.27    1992/04/19 16:59:21
  2. --- Changelog    1992/06/03 18:41:47
  3. ***************
  4. *** 295,297 ****
  5. --- 295,305 ----
  6.            write only the symbols since this is all what gdb needs
  7.   
  8.   ----------------------------- Patchlevel 27 ---------------------------------
  9. + fixstk, printstk.c:: ++jrb
  10. +     fix them up for word aligned machines. ie ifdef WORD_ALIGNED
  11. + Makefile.cross, Makefile.hp:: ++jrb
  12. +     add target for fixstk/printstk to the cross-makefiles.
  13. + ----------------------------- Patchlevel 28 ---------------------------------
  14. *** 1.12    1991/07/23 22:43:21
  15. --- Makefile.cross    1992/06/03 18:41:47
  16. ***************
  17. *** 23,29 ****
  18.   CFLAGS = -O -I. -I$(HOSTINC) -I$(CROSSINC) -DCROSSATARI=1 \
  19.   -DCROSSDIR=\"$(CROSSDIR)\" -DCROSSLIB=\"$(CROSSLIB)\" -DWORD_ALIGNED=1
  20.   
  21. ! ALL = ld sym-ld nm car size size68 tnm xstrip
  22.   
  23.   all: $(ALL)
  24.   #
  25. --- 23,29 ----
  26.   CFLAGS = -O -I. -I$(HOSTINC) -I$(CROSSINC) -DCROSSATARI=1 \
  27.   -DCROSSDIR=\"$(CROSSDIR)\" -DCROSSLIB=\"$(CROSSLIB)\" -DWORD_ALIGNED=1
  28.   
  29. ! ALL = ld sym-ld nm car size size68 tnm xstrip fixstk printstk
  30.   
  31.   all: $(ALL)
  32.   #
  33. ***************
  34. *** 83,88 ****
  35. --- 83,89 ----
  36.       cp tnm $(CROSSBIN)/tnm
  37.       cp xstrip $(CROSSBIN)/xstrip
  38.       cp sym-ld $(CROSSBIN)/sym-ld
  39. +     cp  fixstk printstk $(CROSSBIN)
  40.   
  41.   clean:
  42.       rm -f *.o
  43. *** 1.3    1991/07/23 22:43:21
  44. --- Makefile.gcross    1992/06/03 18:41:47
  45. ***************
  46. *** 22,28 ****
  47.   CFLAGS = -g -I. -I$(HOSTINC) -I$(CROSSINC) -DCROSSATARI=1 \
  48.   -DCROSSDIR=\"$(CROSSDIR)\" -DCROSSLIB=\"$(CROSSLIB)\" -DWORD_ALIGNED=1
  49.   
  50. ! ALL = ld sym-ld nm car size size68 tnm xstrip
  51.   
  52.   all: $(ALL)
  53.   #
  54. --- 22,28 ----
  55.   CFLAGS = -g -I. -I$(HOSTINC) -I$(CROSSINC) -DCROSSATARI=1 \
  56.   -DCROSSDIR=\"$(CROSSDIR)\" -DCROSSLIB=\"$(CROSSLIB)\" -DWORD_ALIGNED=1
  57.   
  58. ! ALL = ld sym-ld nm car size size68 tnm xstrip fixstk printstk
  59.   
  60.   all: $(ALL)
  61.   #
  62. ***************
  63. *** 82,87 ****
  64. --- 82,88 ----
  65.       cp tnm $(CROSSBIN)/tnm
  66.       cp xstrip $(CROSSBIN)/xstrip
  67.       cp sym-ld $(CROSSBIN)/sym-ld
  68. +     cp  fixstk printstk $(CROSSBIN)
  69.   
  70.   clean:
  71.       rm -f *.o
  72. *** 1.2    1992/01/14 19:45:23
  73. --- Makefile.hp    1992/06/03 18:41:47
  74. ***************
  75. *** 29,35 ****
  76.   
  77.   LIBS = $(ALLOCA) $(MALLOC1)
  78.   
  79. ! ALL = ld sym-ld nm car size size68 tnm xstrip
  80.   
  81.   all: $(ALL)
  82.   #
  83. --- 29,35 ----
  84.   
  85.   LIBS = $(ALLOCA) $(MALLOC1)
  86.   
  87. ! ALL = ld sym-ld nm car size size68 tnm xstrip  fixstk printstk
  88.   
  89.   all: $(ALL)
  90.   #
  91. ***************
  92. *** 89,94 ****
  93. --- 89,95 ----
  94.       cp tnm $(CROSSBIN)/tnm
  95.       cp xstrip $(CROSSBIN)/xstrip
  96.       cp sym-ld $(CROSSBIN)/sym-ld
  97. +     cp  fixstk printstk $(CROSSBIN)
  98.   
  99.   clean:
  100.       rm -f *.o
  101. *** 1.25    1992/04/19 16:59:21
  102. --- PatchLev.h    1992/06/03 18:41:48
  103. ***************
  104. *** 1,4 ****
  105. ! #define PatchLevel "27"
  106.   
  107.   /*
  108.    *    the Patch Level above is to identify the version
  109. --- 1,4 ----
  110. ! #define PatchLevel "28"
  111.   
  112.   /*
  113.    *    the Patch Level above is to identify the version
  114. *** 1.4    1991/04/12 18:22:25
  115. --- fixstk.c    1992/06/03 18:41:52
  116. ***************
  117. *** 15,26 ****
  118.    */
  119.   
  120.   #include <stdio.h>
  121.   #include <stdlib.h>
  122. ! #include <unixlib.h>
  123.   #include <string.h>
  124. ! #include <st-out.h>
  125.   
  126. - long lseek(int, long, int);
  127.   static char *sym_names[] = { "__stksize", "__initial_stack" };
  128.   
  129.   long find_offset (fd, fn, what)
  130. --- 15,43 ----
  131.    */
  132.   
  133.   #include <stdio.h>
  134. + #include <st-out.h>
  135. + #if __STDC__
  136.   #include <stdlib.h>
  137. ! #include <unistd.h>
  138.   #include <string.h>
  139. ! #else
  140. ! #include <string.h>
  141. ! extern char *malloc();
  142. ! extern long lseek();
  143. ! #define size_t unsigned long
  144. ! #ifndef FILENAME_MAX
  145. ! # define FILENAME_MAX 128
  146. ! #endif
  147. ! #endif
  148. ! #ifdef WORD_ALIGNED
  149. ! # define SIZEOF_AEXEC ((2*sizeof(short)) + (6*sizeof(long)))
  150. ! # define SIZEOF_ASYM  ((SYMLEN*sizeof(char)) + sizeof(short) + sizeof(long))
  151. ! # define SYM_OFFSET   (sizeof(short) + (3*sizeof(long)))
  152. ! #endif
  153.   
  154.   static char *sym_names[] = { "__stksize", "__initial_stack" };
  155.   
  156.   long find_offset (fd, fn, what)
  157. ***************
  158. *** 34,40 ****
  159. --- 51,61 ----
  160.       int    all = 0;
  161.       int index = 1;
  162.       
  163. + #ifndef WORD_ALIGNED
  164.       if(read(fd, &head, sizeof(head)) != sizeof(head))
  165. + #else
  166. +     if(read_head(fd, &head))
  167. + #endif
  168.       {
  169.       perror(fn);
  170.       exit(2);
  171. ***************
  172. *** 50,56 ****
  173. --- 71,81 ----
  174.       exit(4);
  175.       }
  176.       if(lseek(fd, head.a_text+head.a_data, 1) != 
  177. + #ifndef WORD_ALIGNED
  178.          (head.a_text+head.a_data+sizeof(head)))
  179. + #else
  180. +        (head.a_text+head.a_data+SIZEOF_AEXEC))
  181. + #endif
  182.       {
  183.       perror(fn);
  184.       exit(5);
  185. ***************
  186. *** 57,63 ****
  187. --- 82,92 ----
  188.       }
  189.       for(;;)
  190.       {
  191. + #ifndef WORD_ALIGNED
  192.       if(index && (read(fd, &sym, sizeof(sym)) != sizeof(sym)))
  193. + #else
  194. +     if(index && read_sym(fd, &sym))
  195. + #endif
  196.       {
  197.           fprintf(stderr, "symbol _stksize not found\n");
  198.           exit(6);
  199. ***************
  200. *** 77,83 ****
  201. --- 106,116 ----
  202.       exit(9);
  203.       }
  204.       *what = index;
  205. + #ifndef WORD_ALIGNED
  206.       return sym.a_value + sizeof(head);
  207. + #else
  208. +     return sym.a_value + SIZEOF_AEXEC;
  209. + #endif
  210.   }
  211.   
  212.   long calc_newsize(s)
  213. ***************
  214. *** 85,91 ****
  215.   {
  216.       size_t len = strlen(s) - 1;
  217.       long mul = 1;
  218. !     long atol(const char *);
  219.   
  220.       switch(s[len])
  221.       {
  222. --- 118,124 ----
  223.   {
  224.       size_t len = strlen(s) - 1;
  225.       long mul = 1;
  226. !     long atol();
  227.   
  228.       switch(s[len])
  229.       {
  230. ***************
  231. *** 160,162 ****
  232. --- 193,232 ----
  233.       return close(fd);
  234.   }
  235.   
  236. + #ifdef WORD_ALIGNED
  237. + #ifndef atarist
  238. + # define lread  read
  239. + # define lwrite write
  240. + #endif
  241. + /*
  242. +  * read header -- return !0 on err
  243. +   */
  244. + #define ck_read(fd, addr, siz) \
  245. +   if((long)siz != lread(fd, addr, (long)siz)) return !0;
  246. +   
  247. + int read_head (fd, a)
  248. + int fd;
  249. + struct aexec *a;
  250. + {
  251. +     ck_read(fd, &a->a_magic,   sizeof(a->a_magic));
  252. +     ck_read(fd, &a->a_text,    sizeof(a->a_text));
  253. +     ck_read(fd, &a->a_data,    sizeof(a->a_data));
  254. +     ck_read(fd, &a->a_bss,     sizeof(a->a_bss));
  255. +     ck_read(fd, &a->a_syms,    sizeof(a->a_syms));
  256. +     ck_read(fd, &a->a_AZero1,  sizeof(a->a_AZero1));
  257. +     ck_read(fd, &a->a_AZero2,  sizeof(a->a_AZero2));
  258. +     ck_read(fd, &a->a_isreloc, sizeof(a->a_isreloc));
  259. +     return 0;
  260. + }
  261. + int read_sym(fd, s)
  262. + int fd;
  263. + struct asym *s;
  264. + {
  265. +     ck_read(fd, s->a_name, 8);
  266. +     ck_read(fd, &(s->a_type), sizeof(short));
  267. +     ck_read(fd, &(s->a_value), sizeof(long));
  268. +     return 0;
  269. + }
  270. + #endif
  271. *** 1.32    1992/04/19 16:59:21
  272. --- ld.c    1992/06/03 18:41:53
  273. ***************
  274. *** 2306,2311 ****
  275. --- 2306,2314 ----
  276.       sp->max_common_size = nlist_p->n_value;
  277.   
  278.         /* Are we defining it as a set element?  */
  279. + #if 0
  280. +       if (SET_ELEMENT_P (type)) /* potential fix but i dont see why ++jrb */
  281. + #endif
  282.         if (SET_ELEMENT_P (type)
  283.         && (!olddef || (olddef && sp->max_common_size)))
  284.       set_vector_count++;
  285. *** 1.4    1991/04/12 18:22:25
  286. --- printstk.c    1992/06/03 18:41:54
  287. ***************
  288. *** 10,21 ****
  289.    */
  290.   
  291.   #include <stdio.h>
  292.   #include <stdlib.h>
  293. ! #include <unixlib.h>
  294.   #include <string.h>
  295. ! #include <st-out.h>
  296.   
  297. ! long lseek(int, long, int);
  298.   static char *sym_names[] = { "__stksize", "__initial_stack" };
  299.   
  300.   long find_offset (fd, fn, what)
  301. --- 10,37 ----
  302.    */
  303.   
  304.   #include <stdio.h>
  305. + #include <st-out.h>
  306. + #if __STDC__
  307.   #include <stdlib.h>
  308. ! #include <unistd.h>
  309.   #include <string.h>
  310. ! #else
  311. ! #include <string.h>
  312. ! extern char *malloc();
  313. ! extern long lseek();
  314. ! #define size_t unsigned long
  315. ! #ifndef FILENAME_MAX
  316. ! # define FILENAME_MAX 128
  317. ! #endif
  318. ! #endif
  319.   
  320. ! #ifdef WORD_ALIGNED
  321. ! # define SIZEOF_AEXEC ((2*sizeof(short)) + (6*sizeof(long)))
  322. ! # define SIZEOF_ASYM  ((SYMLEN*sizeof(char)) + sizeof(short) + sizeof(long))
  323. ! # define SYM_OFFSET   (sizeof(short) + (3*sizeof(long)))
  324. ! #endif
  325.   static char *sym_names[] = { "__stksize", "__initial_stack" };
  326.   
  327.   long find_offset (fd, fn, what)
  328. ***************
  329. *** 29,35 ****
  330. --- 45,55 ----
  331.       int    all = 0;
  332.       int index = 1;
  333.       
  334. + #ifndef WORD_ALIGNED
  335.       if(read(fd, &head, sizeof(head)) != sizeof(head))
  336. + #else
  337. +     if(read_head(fd, &head))
  338. + #endif
  339.       {
  340.       perror(fn);
  341.       exit(2);
  342. ***************
  343. *** 45,51 ****
  344. --- 65,75 ----
  345.       exit(4);
  346.       }
  347.       if(lseek(fd, head.a_text+head.a_data, 1) != 
  348. + #ifndef WORD_ALIGNED
  349.          (head.a_text+head.a_data+sizeof(head)))
  350. + #else
  351. +        (head.a_text+head.a_data+SIZEOF_AEXEC))
  352. + #endif
  353.       {
  354.       perror(fn);
  355.       exit(5);
  356. ***************
  357. *** 52,58 ****
  358. --- 76,86 ----
  359.       }
  360.       for(;;)
  361.       {
  362. + #ifndef WORD_ALIGNED
  363.       if(index && (read(fd, &sym, sizeof(sym)) != sizeof(sym)))
  364. + #else
  365. +     if(index && read_sym(fd, &sym))
  366. + #endif
  367.       {
  368.           fprintf(stderr, "symbol _stksize not found\n");
  369.           exit(6);
  370. ***************
  371. *** 72,78 ****
  372. --- 100,110 ----
  373.       exit(9);
  374.       }
  375.       *what = index;
  376. + #ifndef WORD_ALIGNED
  377.       return sym.a_value + sizeof(head);
  378. + #else
  379. +     return sym.a_value + SIZEOF_AEXEC;
  380. + #endif
  381.   }
  382.   
  383.   int main(argc, argv)
  384. ***************
  385. *** 109,111 ****
  386. --- 141,180 ----
  387.       return close(fd);
  388.   }
  389.   
  390. + #ifdef WORD_ALIGNED
  391. + #ifndef atarist
  392. + # define lread  read
  393. + # define lwrite write
  394. + #endif
  395. + /*
  396. +  * read header -- return !0 on err
  397. +   */
  398. + #define ck_read(fd, addr, siz) \
  399. +   if((long)siz != lread(fd, addr, (long)siz)) return !0;
  400. +   
  401. + int read_head (fd, a)
  402. + int fd;
  403. + struct aexec *a;
  404. + {
  405. +     ck_read(fd, &a->a_magic,   sizeof(a->a_magic));
  406. +     ck_read(fd, &a->a_text,    sizeof(a->a_text));
  407. +     ck_read(fd, &a->a_data,    sizeof(a->a_data));
  408. +     ck_read(fd, &a->a_bss,     sizeof(a->a_bss));
  409. +     ck_read(fd, &a->a_syms,    sizeof(a->a_syms));
  410. +     ck_read(fd, &a->a_AZero1,  sizeof(a->a_AZero1));
  411. +     ck_read(fd, &a->a_AZero2,  sizeof(a->a_AZero2));
  412. +     ck_read(fd, &a->a_isreloc, sizeof(a->a_isreloc));
  413. +     return 0;
  414. + }
  415. + int read_sym(fd, s)
  416. + int fd;
  417. + struct asym *s;
  418. + {
  419. +     ck_read(fd, s->a_name, 8);
  420. +     ck_read(fd, &(s->a_type), sizeof(short));
  421. +     ck_read(fd, &(s->a_value), sizeof(long));
  422. +     return 0;
  423. + }
  424. + #endif
  425. *** 1.18    1992/04/19 16:59:21
  426. --- sym-ld.c    1992/06/03 18:41:56
  427. ***************
  428. *** 2055,2060 ****
  429. --- 2055,2063 ----
  430.       sp->max_common_size = nlist_p->n_value;
  431.   
  432.         /* Are we defining it as a set element?  */
  433. + #if 0
  434. +       if (SET_ELEMENT_P (type)) /* potential fix but i dont see why ++jrb */
  435. + #endif
  436.         if (SET_ELEMENT_P (type)
  437.         && (!olddef || (olddef && sp->max_common_size)))
  438.       set_vector_count++;
  439.